<?php


class dbaOnlineUser {

   function dbaOnlineUser(&$dba){
     $this->dba = &$dba;
   }

   function check($uid){
     $sth = $this->dba->query("select uid from ".$this->dba->tableforwarder."_onlineUser where uid = $uid;");
     return ($sth)?$sth->num_rows():false;
   }

   function del($uid){
     return $this->dba->query("delete from ".$this->dba->tableforwarder."_onlineUser where uid = $uid;");
   }

   function update($uid){
     return $this->dba->query("update ".$this->dba->tableforwarder."_onlineUser set time=".time()." where uid = $uid;");
   }

   function add($uid,$name,$long_name){
     return $this->dba->query("insert into ".$this->dba->tableforwarder."_onlineUser (uid,name,long_name,time)"
        ." values ('$uid',".$this->dba->quote($name).",".$this->dba->quote($long_name).",'".time()."');");
   }
}

?>